<?php
class Customer_Form_Customer_Update extends Zend_Form
{
	public function __construct(Zend_Controller_Action $controller)
	{
		//customer_code
		$customer_code=$this->createElement ( 'text', 'customer_code' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_code' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_code' ))
		->setRequired(false)
		->setAttrib ( 'class','lock' )
		;
		
		//customer_name
		$customer_name=$this->createElement ( 'text', 'customer_name' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_name' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_name' ))
		->setRequired(true)
		;
		
		//customer_address
		$customer_address=$this->createElement ( 'textarea', 'customer_address' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_address' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_address' ))
		->setRequired(true)
		;
		
		//customer_tax_code
		$customer_tax_code=$this->createElement ( 'text', 'customer_tax_code' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_tax_code' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_tax_code' ))
		//->setRequired(true)
		;
		
		//customer_phone
		$customer_phone=$this->createElement ( 'text', 'customer_phone' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_phone' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_phone' ))
		//->setRequired(true)
		;
		
		//customer_fax
		$customer_fax=$this->createElement ( 'text', 'customer_fax' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_fax' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_fax' ))
		;
		
		//customer_email
		$customer_email=$this->createElement ( 'text', 'customer_email' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_email' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_email' ))
		->addValidator('emailAddress')
		;
		
		//customer_website
		$customer_website=$this->createElement ( 'text', 'customer_website' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_website' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_website' ))
		;
		
		//customer_note
		$customer_note=$this->createElement ( 'textarea', 'customer_note' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_note' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_note' ))
		;
		
		//customer_vnd_account_code
		$customer_vnd_account_code=$this->createElement ( 'textarea', 'customer_vnd_account_code' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_vnd_account_code' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_vnd_account_code' ))
		;
		
		//customer_usd_account_code
		$customer_usd_account_code=$this->createElement ( 'textarea', 'customer_usd_account_code' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_usd_account_code' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_usd_account_code' ))
		;
		
		//customer_rep_name
		$customer_rep_name=$this->createElement ( 'text', 'customer_rep_name' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_rep_name' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_rep_name' ))
		;
		
		//customer_rep_address
		$customer_rep_address=$this->createElement ( 'textarea', 'customer_rep_address' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_rep_address' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_rep_address' ))
		;
		
		//customer_rep_phone
		$customer_rep_phone=$this->createElement ( 'text', 'customer_rep_phone' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_rep_phone' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_rep_phone' ))
		;
		
		//customer_rep_email
		$customer_rep_email=$this->createElement ( 'text', 'customer_rep_email' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_rep_email' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_rep_email' ))
		->addValidator('emailAddress')
		;
		
		//customer_rep_position
		$customer_rep_position=$this->createElement ( 'text', 'customer_rep_position' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_rep_position' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_rep_position' ))
		;
		
		//customer_rep_id_number
		$customer_rep_id_number=$this->createElement ( 'text', 'customer_rep_id_number' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_rep_id_number' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_rep_id_number' ))
		;
		
		//customer_rep_note
		$customer_rep_note=$this->createElement ( 'textarea', 'customer_rep_note' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_rep_note' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_rep_note' ))
		;
		
		//customer_contact_name
		$customer_contact_name=$this->createElement ( 'text', 'customer_contact_name' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_contact_name' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_contact_name' ))
		;
		
		//customer_contact_phone
		$customer_contact_phone=$this->createElement ( 'text', 'customer_contact_phone' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_contact_phone' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_contact_phone' ))
		;
		
		//customer_contact_position
		$customer_contact_position=$this->createElement ( 'text', 'customer_contact_position' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_contact_position' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_contact_position' ))
		;
		
		//customer_status
		$customer_status=$this->createElement ( 'radio', 'customer_status' )
		->setLabel ( $controller->getHelper('common')->getCaption('customer_status' ))
		->setDescription ( $controller->getHelper('common')->getDescription('customer_status' ))
		->setMultiOptions(array(1=>'Kích hoạt',0=>'Vô hiệu'))
		->setValue(1)
		;
		
		$this->addElements ( array (
			$customer_code,
			$customer_name,
			$customer_address,
			$customer_tax_code,
			$customer_phone,
			$customer_fax,
			$customer_email,
			$customer_website,
			$customer_note,
			$customer_vnd_account_code,
			$customer_usd_account_code,
			$customer_rep_name,
			$customer_rep_address,
			$customer_rep_phone,
			$customer_rep_email,
			$customer_rep_position,
			$customer_rep_id_number,
			$customer_rep_note,
			$customer_contact_name,
			$customer_contact_phone,
			$customer_contact_position,
			$customer_status,
		) );	
		
		$controller->getHelper ( 'common' )->form ( $this );
	}
}